class Solution {
public:
    int maxOperations(vector<int>& nums)
    {
        if (nums.size() < 2) return 0;

        int n = nums.size();
        int ans = 0;
        int prev = nums[0] + nums[1];
        for (int i = 0; i < n - 1; i += 2)
            if (nums[i] + nums[i + 1] == prev) ans++;
            else break;
        return ans;
    }
};